﻿using System.Web.Mvc;

namespace Transport.Core.Models.Parcels
{
    public class PaymentTypes
    {
        public enum EnumPaymentTypes
        {
            Debt = 1,
            Cash = 2,
            Collection = 3
        }

        public static SelectList GetPaymentTypes()
        {
            var values = new[]
                            {
                                new { Value = (int)EnumPaymentTypes.Debt, Text = "Nợ" },
                                new { Value = (int)EnumPaymentTypes.Cash, Text = "Tiền mặt" },
                                new { Value = (int)EnumPaymentTypes.Collection, Text = "Thu hộ" }
                            };
            return new SelectList(values, "Value", "Text");
        }

        public static string GetPaymentType(int id)
        {
            switch (id)
            {
                case (int)EnumPaymentTypes.Debt:
                    return "Nợ";
                case (int)EnumPaymentTypes.Cash:
                    return "Tiền mặt";
                case (int)EnumPaymentTypes.Collection:
                    return "Thu hộ";
            }
            return string.Empty;
        }
    }
}
